#include<iostream>
#include<string>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>

class Addr
{
public:
Addr(struct sockaddr_in&tmp):_addr(tmp)
{
    _ip=inet_ntoa(_addr.sin_addr);
    _port=ntohs(_addr.sin_port);
}
std::string IP()
{
    return _ip;
}
uint16_t Port()
{
    return _port;
}
private:
struct sockaddr_in _addr;
uint16_t _port;
std::string _ip;
};